<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../Vue.js/vue.js"></script>
</head>
<body>
    <div class="root">
        <input type="text" class="t1" v-model = "fn"><br/><br/>
        <input type="text" class="t2" v-model = "ln"><br/><br/>
        <span>{{fullname}}</span>
    </div>
</body>
<script>
    const vm = new Vue({
        el: ".root",
        data: {
            fn: "张",
            ln: "三"
        },
        computed: {
            fullname: {
                get(){
                    return this.fn + "-" + this.ln;
                }
            }
        }
    })
</script>
</html>